package com.lhc.nacosprovider.mapper;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lhc.nacosprovider.entity.DBTestEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

/**
 * @author liuchaoqun
 * @date 2022/6/25
 * @Description 测试Mapper
 */
@Mapper
public interface DBTestMapper extends BaseMapper<DBTestEntity> {

    default List<DBTestEntity> getDataEndWithToday(){
        String tenToday = DateUtil.today() + " 10:00:00";
        QueryWrapper<DBTestEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().lt(DBTestEntity::getTimestamp, tenToday);
        return this.selectList(queryWrapper);
    }
}
